Skip to contentSkip to conversation

Latest git fails to compile with radeon

Bug 101189 [email protected] 1 participant 23 messages May 25, 2017 – Jun 17, 2017

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Bug ID: 101189
Summary: Latest git fails to compile with radeon
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: major
Priority: medium
Component: Drivers/Gallium/r600
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

It seems that commit de9dd4f9f1bb5984c554d0acf7d2592951ecc53f introduced a bug in which you were not able to compile radeon drivers. The latest git currently fails to build with:

/var/tmp/portage/media-libs/mesa-9999/work/mesa-9999/src/amd/common/ac_gpu_info.h:31:20:
fatal error: amdgpu.h: No such file or directory

I'm building mesa-9999 on Gentoo. My use flags are:
USE="classic d3d9 dri3 egl gallium gbm gles2 llvm nptl opencl pax_kernel pic vaapi vdpau wayland xa -bindist -debug -gles1 -openmax -osmesa (-selinux) -unwind% -valgrind -vulkan -xvmc" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="i965 intel r600 radeon (-freedreno) -i915 -imx -nouveau -r100 -r200 -r300 -radeonsi (-vc4) (-vivante) -vmware"

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Eric Engestrom <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Eric Engestrom <[email protected]> --- Fixed by:

commit 44b29dd7b6cdc1a3fde58c367b9de8081ac4167b

Author: Eric Engestrom <[email protected]>
Date:   Fri May 26 11:59:20 2017 +0100

amd/common: add missing libdrm include path

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Eric Engestrom <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Eric Engestrom <[email protected]> --- *** Bug 101190 has been marked as a duplicate of this bug. ***

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Pavel Vinogradov <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #3 from Pavel Vinogradov <[email protected]> --- drm from git doesn't provide amdgpu.h, but amdgpu_drm.h.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #4 from Alex Deucher <[email protected]> --- (In reply to Pavel Vinogradov from comment #3)

Quoted 1 line

drm from git doesn't provide amdgpu.h, but amdgpu_drm.h.

It provides both:
https://cgit.freedesktop.org/mesa/drm/tree/amdgpu/amdgpu.h
https://cgit.freedesktop.org/mesa/drm/tree/include/drm/amdgpu_drm.h

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #5 from Pavel Vinogradov <[email protected]> --- hm, strange. do I need to build amdgpu kms as well? for simple radeon hd 4650?

(In reply to Alex Deucher from comment #4)

Quoted 6 lines

(In reply to Pavel Vinogradov from comment #3)

Quoted 1 line

drm from git doesn't provide amdgpu.h, but amdgpu_drm.h.

It provides both:
https://cgit.freedesktop.org/mesa/drm/tree/amdgpu/amdgpu.h
https://cgit.freedesktop.org/mesa/drm/tree/include/drm/amdgpu_drm.h

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #6 from Alex Deucher <[email protected]> --- (In reply to Pavel Vinogradov from comment #5)

Quoted 2 lines

hm, strange. do I need to build amdgpu kms as well? for simple radeon hd 4650?

You don't need the amdgpu kernel driver.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #7 from Pavel Vinogradov <[email protected]> --- Sorry, I meant the amdgpu kms library in drm itself.

(In reply to Alex Deucher from comment #6)

Quoted 5 lines

(In reply to Pavel Vinogradov from comment #5)

Quoted 2 lines

hm, strange. do I need to build amdgpu kms as well? for simple radeon hd 4650?

You don't need the amdgpu kernel driver.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #9 from John Dallahan <[email protected]> --- Created attachment 131547
--> https://bugs.freedesktop.org/attachment.cgi?id=131547&action=edit
Complete build log

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #10 from John Dallahan <[email protected]> --- This bug is still occurring with the latest git. I attached the complete build log.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #11 from jospezial <[email protected]> --- (In reply to Alex Deucher from comment #4)

Quoted 6 lines

(In reply to Pavel Vinogradov from comment #3)

Quoted 1 line

drm from git doesn't provide amdgpu.h, but amdgpu_drm.h.

It provides both:
https://cgit.freedesktop.org/mesa/drm/tree/amdgpu/amdgpu.h
https://cgit.freedesktop.org/mesa/drm/tree/include/drm/amdgpu_drm.h

libdrm only installs amdgpu.h in /usr/include/libdrm/ if it is compiled with amdgpu support.

If libdrm is compiled with radeon support only, then /usr/include/libdrm/amdgpu_drm.h is installed only. Tested with x11-libs/libdrm-2.4.80::gentoo

The bug is introduced in
https://cgit.freedesktop.org/mesa/mesa/commit/?id=f187a493225e33c5ce514c731a0a140d61dacb0b

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #12 from Emil Velikov <[email protected]> --- This series [1] should address it properly although there's some contentious points around patch 2/5

[1] https://patchwork.freedesktop.org/series/24960/

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #13 from Pavel Vinogradov <[email protected]> --- works like a charm. thanks.

(In reply to Emil Velikov from comment #12)

Quoted 4 lines

This series [1] should address it properly although there's some contentious points around patch 2/5

[1] https://patchwork.freedesktop.org/series/24960/

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #14 from Emil Velikov <[email protected]> --- For anyone wondering why patches have not been merged, yet.

Patch 2/5 neuters the partial Opencl support in r600, in an attempt to untangle the convoluted dependencies. A few people are unhappy about it (understandably so) and I've not pushed the patches so that they can resolve this better.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Pavel Vinogradov <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Benji Wiebe <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #15 from Benji Wiebe <[email protected]> --- With this patch https://patchwork.freedesktop.org/patch/158696/ the build is broken for me now, not using radeon. Two issues: 1) when you remove amdgpu.h from ac_gpu_info.h, you need to (but didn't) add includes for stdint.h and stdbool.h. 2) I get the following error when compiling (after adding the stdint/stdbool includes):

In file included from ../../../src/amd/common/ac_gpu_info.c:37:0:
/usr/local/include/libdrm/amdgpu.h:107:31: error: conflicting types for ‘amdgpu_device_handle’

 typedef struct amdgpu_device *amdgpu_device_handle;
                               ^~~~~~~~~~~~~~~~~~~~
In file included from ../../../src/amd/common/ac_gpu_info.c:26:0:
../../../src/amd/common/ac_gpu_info.h:39:16: note: previous declaration of
‘amdgpu_device_handle’ was here
 typedef void * amdgpu_device_handle;
                ^~~~~~~~~~~~~~~~~~~~

And then a few more compiler warnings/errors that I believe tie into the above one and will be resolved when the above is resolved.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#17 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #16 from Pavel Vinogradov <[email protected]> --- try current git, the patchset was applied there smoothly.

(In reply to Benji Wiebe from comment #15)

Quoted 21 lines

With this patch https://patchwork.freedesktop.org/patch/158696/ the build is broken for me now, not using radeon. Two issues: 1) when you remove amdgpu.h from ac_gpu_info.h, you need to (but didn't) add includes for stdint.h and stdbool.h. 2) I get the following error when compiling (after adding the stdint/stdbool includes):

In file included from ../../../src/amd/common/ac_gpu_info.c:37:0:
/usr/local/include/libdrm/amdgpu.h:107:31: error: conflicting types for ‘amdgpu_device_handle’

 typedef struct amdgpu_device *amdgpu_device_handle;
                               ^~~~~~~~~~~~~~~~~~~~
In file included from ../../../src/amd/common/ac_gpu_info.c:26:0:
../../../src/amd/common/ac_gpu_info.h:39:16: note: previous declaration of
‘amdgpu_device_handle’ was here
 typedef void * amdgpu_device_handle;
                ^~~~~~~~~~~~~~~~~~~~

And then a few more compiler warnings/errors that I believe tie into the above one and will be resolved when the above is resolved.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#18 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #17 from Benji Wiebe <[email protected]> --- (In reply to Pavel Vinogradov from comment #16)

Quoted 1 line

try current git, the patchset was applied there smoothly.

Yes, I tried current git. I did a git bisect and it pointed to that patch I linked. I've also tried current git as of 1:30 AM CDT, still no go.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#19 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #18 from Benji Wiebe <[email protected]> --- Tomorrow if you haven't gotten it figured out yet I can start up a VM and do a completely fresh build (though to the best of my knowledge this was fresh too, I deleted the build dir first).

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#20 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

--- Comment #19 from Mauro Rossi <[email protected]> --- Hi,

with current patch "ac: remove amdgpu.h dependency" applied, on Android (nougat-x86) I get the following building errors:

In file included from external/mesa/src/amd/common/ac_gpu_info.c:26:
external/mesa/src/amd/common/ac_gpu_info.h:41:2: error: unknown type name 'uint32_t'

        uint32_t                    pci_domain;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:42:2: error: unknown type name
'uint32_t'
        uint32_t                    pci_bus;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:43:2: error: unknown type name
'uint32_t'
        uint32_t                    pci_dev;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:44:2: error: unknown type name
'uint32_t'
        uint32_t                    pci_func;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:47:2: error: unknown type name
'uint32_t'
        uint32_t                    pci_id;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:50:2: error: unknown type name
'uint32_t'
        uint32_t                    pte_fragment_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:51:2: error: unknown type name
'uint32_t'
        uint32_t                    gart_page_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:52:2: error: unknown type name
'uint64_t'
        uint64_t                    gart_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:53:2: error: unknown type name
'uint64_t'
        uint64_t                    vram_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:54:2: error: unknown type name
'uint64_t'
        uint64_t                    vram_vis_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:55:2: error: unknown type name
'uint64_t'
        uint64_t                    max_alloc_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:56:2: error: unknown type name
'uint32_t'
        uint32_t                    min_alloc_size;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:57:2: error: unknown type name
'bool'
        bool                        has_dedicated_vram;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:58:2: error: unknown type name
'bool'
        bool                        has_virtual_memory;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:59:2: error: unknown type name
'bool'
        bool                        gfx_ib_pad_with_type2;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:60:2: error: unknown type name
'bool'
        bool                        has_hw_decode;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:61:2: error: unknown type name
'uint32_t'
        uint32_t                    num_sdma_rings;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:62:2: error: unknown type name
'uint32_t'
        uint32_t                    num_compute_rings;
        ^
external/mesa/src/amd/common/ac_gpu_info.h:63:2: error: unknown type name
'uint32_t'
        uint32_t                    uvd_fw_version;
        ^

fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.

The following changes are necessary in src/amd/common/ac_gpu_info.h

utente@utente-System-Product-Name:~/nougat-x86/external/mesa$ git diff
src/amd/common/ac_gpu_info.h +3 -0
index a72ab58f9a..616a1df7fa 100644
@@ -26,6 +26,9 @@
 #ifndef AC_GPU_INFO_H
 #define AC_GPU_INFO_H
 
+#include <stdint.h>
+#include <stdbool.h>
+
 #include "amd_family.h"
 
 #ifdef __cplusplus

Having applied that I still get the following build error:

In file included from external/mesa/src/amd/common/ac_surface.c:38:
external/libdrm/amdgpu/amdgpu.h:107:31: error: typedef redefinition with different types ('struct amdgpu_device *' vs 'void *')

typedef struct amdgpu_device *amdgpu_device_handle;
                              ^

1 error generated.

Could you please check on the latter and provide corrective patch? I am available to test build on nougat-x86

Thanks

Mauro

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#21 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=101189

Emil Velikov <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #20 from Emil Velikov <[email protected]> --- The issues should be resolved in master, as of

commit 1f958c1337290b4062a77f79fc101bb9f4bdf515 (origin/master, origin/HEAD)

Author: Emil Velikov <[email protected]>
Date:   Fri Jun 16 19:53:50 2017 +0100

radeonsi: include ac_binary.h for struct ac_shader_binary

For seemingly unrelated build issues, please file a separate report.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel